home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / PInterfaces / Interrupts.p < prev    next >
Text File  |  1996-05-01  |  3KB  |  113 lines

  1. {
  2.      File:        Interrupts.p
  3.  
  4.      Contains:    Public Interface to the Interrupt Manager.
  5.  
  6.      Version:    Technology:    PowerSurge 1.0.2 and beyond (including Copland)
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT Interrupts;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __INTERRUPTS__}
  28. {$SETC __INTERRUPTS__ := 1}
  29.  
  30. {$I+}
  31. {$SETC InterruptsIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __TYPES__}
  35. {$I Types.p}
  36. {$ENDC}
  37.  
  38. {$PUSH}
  39. {$ALIGN MAC68K}
  40. {$LibExport+}
  41.  
  42. {$IFC FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE }
  43. {   Interrupt types   }
  44.  
  45. TYPE
  46.     InterruptSetID = ^LONGINT;
  47.     InterruptMemberNumber                = LONGINT;
  48.     InterruptSetMemberPtr = ^InterruptSetMember;
  49.     InterruptSetMember = RECORD
  50.         setID:                    InterruptSetID;
  51.         member:                    InterruptMemberNumber;
  52.     END;
  53.  
  54.  
  55. CONST
  56.     kISTChipInterruptSource        = 0;
  57.     kISTOutputDMAInterruptSource = 1;
  58.     kISTInputDMAInterruptSource    = 2;
  59.     kISTPropertyMemberCount        = 3;
  60.  
  61.  
  62. TYPE
  63.     ISTProperty                            = ARRAY [0..2] OF InterruptSetMember;
  64.     InterruptReturnValue                = LONGINT;
  65.  
  66. CONST
  67.     kFirstMemberNumber            = 1;
  68.     kIsrIsComplete                = 0;
  69.     kIsrIsNotComplete            = -1;
  70.     kMemberNumberParent            = -2;
  71.  
  72.  
  73. TYPE
  74.     InterruptSourceState                = BOOLEAN;
  75.  
  76. CONST
  77.     kSourceWasEnabled            = 1;
  78.     kSourceWasDisabled            = 0;
  79.  
  80.  
  81. TYPE
  82.     InterruptHandler = ProcPtr;  { FUNCTION InterruptHandler(ISTmember: InterruptSetMember; refCon: UNIV Ptr; theIntCount: UInt32): InterruptMemberNumber; C; }
  83.  
  84.     InterruptEnabler = ProcPtr;  { PROCEDURE InterruptEnabler(ISTmember: InterruptSetMember; refCon: UNIV Ptr); C; }
  85.  
  86.     InterruptDisabler = ProcPtr;  { FUNCTION InterruptDisabler(ISTmember: InterruptSetMember; refCon: UNIV Ptr): ByteParameter; C; }
  87.  
  88.  
  89. CONST
  90.     kReturnToParentWhenComplete    = $00000001;
  91.     kReturnToParentWhenNotComplete = $00000002;
  92.  
  93.  
  94. TYPE
  95.     InterruptSetOptions                    = OptionBits;
  96. {   Interrupt Services   }
  97. FUNCTION CreateInterruptSet(parentSet: InterruptSetID; parentMember: InterruptMemberNumber; setSize: InterruptMemberNumber; VAR setID: InterruptSetID; options: InterruptSetOptions): OSStatus; C;
  98. FUNCTION InstallInterruptFunctions(setID: InterruptSetID; member: InterruptMemberNumber; refCon: UNIV Ptr; handlerFunction: InterruptHandler; enableFunction: InterruptEnabler; disableFunction: InterruptDisabler): OSStatus; C;
  99. FUNCTION GetInterruptFunctions(setID: InterruptSetID; member: InterruptMemberNumber; VAR refCon: UNIV Ptr; VAR handlerFunction: InterruptHandler; VAR enableFunction: InterruptEnabler; VAR disableFunction: InterruptDisabler): OSStatus; C;
  100. FUNCTION ChangeInterruptSetOptions(setID: InterruptSetID; options: InterruptSetOptions): OSStatus; C;
  101. FUNCTION GetInterruptSetOptions(setID: InterruptSetID; VAR options: InterruptSetOptions): OSStatus; C;
  102. {$ENDC}
  103. {$ALIGN RESET}
  104. {$POP}
  105.  
  106. {$SETC UsingIncludes := InterruptsIncludes}
  107.  
  108. {$ENDC} {__INTERRUPTS__}
  109.  
  110. {$IFC NOT UsingIncludes}
  111.  END.
  112. {$ENDC}
  113.